<?php
function helper_obtenerMeses(){
   $ainicial=2011;
   $afinal=2012;
   $minicial=1;
   $mfinal=6;
   $aux=$ainicial;
   $imes=0;
   $medmes=0;
   $fmes=0;
   $tomes=0;
   $cmes=0;
   if($ainicial==$afinal){
        if($minicial==$mfinal){
          $cmes=1;
        }else{
	  for($mc=$minicial;$mc<=$mfinal;$mc++){
		$cmes++;
	  } $cmes;
        }$tomes=$cmes;
   }else{
       for($mc=$minicial;$mc<=12;$mc++){
             $imes++;
       }$mc=13; $imes;
       if($aux+1==$afinal){
         if($mc==13){
	  for($mc=1;$mc<=$mfinal;$mc++){
               $fmes++;
          }
	 }$tomes=$fmes+$imes;
       }else{
         while($aux+1!=$afinal){
	   if($mc==13){
	     for($mc=1;$mc<=12;$mc++){
		$medmes++;
             }
           }
	  $aux++; $mc=13;
         } $medmes;
      }
      if($mc==13){
	for($mc=1;$mc<=$mfinal;$mc++){
              $fmes++;
        }
      } $fmes;
      $tomes=$imes+$medmes+$fmes;}
      return $tomes;
 
}

?>
